package com.mkyong.app;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

/**
 * Application Lifecycle Listener implementation class EndpointContextListner
 * 
 */
@WebListener
public class EndpointContextListner implements ServletContextListener {

	public static final String DB_LOCATION = "H:\\Lecture Notes\\Master Thesis\\Endpoint\\ontology\\nurse";
	public static final String OWL_LOCATION = "H:\\Lecture Notes\\Master Thesis\\Endpoint\\ontology\\v3_NursingReport.owl";
	public static final String MYSQL_DRIVER = "jdbc:mysql://localhost/owl";
	public static final String DB_USER = "root";
	public static final String DB_PSW = "";

	@Override
	public void contextDestroyed(ServletContextEvent event) {

	}

	@Override
	public void contextInitialized(ServletContextEvent event) {
		try {
			new TripleStore().setupStore(OWL_LOCATION, DB_LOCATION);

			new RelationalStore().setupStore();

		} catch (Exception e) {
			e.printStackTrace();

		}

	}

}
